package projekt.kickerCarGul;

import lejos.nxt.Motor;

public class DriveBehavior extends Behavior{

	private Motor wheels; 
	private final int wheelspeed = 65;


	public DriveBehavior(String name, int LCDrow, Behavior subsumedBehavior, int light, int ball) {
		super(name, LCDrow, subsumedBehavior, light, ball);
		wheels = Motor.A;
	}

	public void run(){
		while (true)
		{     		
			suppress();
			if(getDirection() == true){
				forward(wheelspeed);
			}
			else{
				backward(wheelspeed);
			}
			release(); 		    
		}
	}
	
	private void slowdown(int direction){
		int curSpeed = wheelspeed;
		while(curSpeed > 0){
			forward(curSpeed*direction);
			delay(10);
			curSpeed--;
		}
	}

}
